import java.util.Scanner;
// 1:无需package
// 2: 类名必须Main, 不可修改

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        int[] h=new int[n];
        int[] w=new int[n];
        for (int i = 0; i <n ; i++) {
            h[i] = scan.nextInt();
            w[i] = scan.nextInt();
        }
        int max=100000;
        int min=1;
        int ave;
        int cut=0;
        int ans=0;//每块巧克力最大边长//采用二分法，当min>max跳出循环//取最大边界和最小边界的平均值（ave）代入循环,while(max>=min)
        while (min<=max){
            ave=(max+min)/2;
            cut=0;
            //循环，多少个n循环多少次，记录所切数目cut
            for (int i = 0; i <n ; i++) {
                cut+=(h[i]/ave)*(w[i]/ave);
            }
            //ave太大不符合要求cut<k，max=ave-1
            if (cut<k){
                max=ave-1;}
                //ave小但符合每人都有巧克力的要求cut>k，min=ave+1，记录边长
            else{
                min=ave+1;
                ans=ave;
            }
        }
        System.out.println(ans);
        scan.close();
    }
}